package com.bank.study;

import com.bank.study.pojo.po.User;
import com.sun.tools.attach.VirtualMachine;

import java.util.Arrays;

public class JavaAfterAgentDemo {

    public static void main(String[] args) throws Exception {
        System.out.println("main start");
        System.out.println("main args :" + Arrays.toString(args));
        VirtualMachine vm = VirtualMachine.attach("22016");
        vm.loadAgent("D:\\workspace\\java-study\\java-agent-demo\\target\\java-agent-demo-1.0-SNAPSHOT-jar-with-dependencies.jar","agentmain");
        vm.detach();
        System.out.println("main end");
    }
}

